package com.zyk.leetcode;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

/**
 * @author zhangsan
 * @date 2021/4/13 14:07
 */
public class C1825 {

    static class MKAverage {

        Queue<Integer> elements;
        int m, k;
        int[] compute;

        public MKAverage(int m, int k) {
            elements = new LinkedList<>();
            this.m = m;
            this.k = k;
            this.compute = new int[m];
        }

        public void addElement(int num) {
            elements.add(num);
        }

        public int calculateMKAverage() {
            if(elements.size() < m)
                return -1;
            for (int i = 0; i < m; i++) {
                compute[i] = elements.poll();
            }
            Arrays.sort(compute);
            int sum = 0;
            for (int i = 0; i < k; i++) {
                compute[i] = 0;
                compute[k-i-1] = 0;
            }


            /*for (int i = 0; i < compute.length; i++) {
                elements.add(compute[i]);
            }
            return ans;*/
            return 1;
        }
    }


    // for test
    public static void main(String[] args) {

    }

}
